using System.Collections;
using UnityEngine;

// 属性系统管理器
public class StatSystem : MonoBehaviour
{
    void OnEnable()
    {
        // 注册属性增加动作的执行器
        ActionSystem.AttachPerformer<IncreaseStatsGA>(IncreaseStatsPerformer);
    }

    void OnDisable()
    {
        // 注销执行器
        ActionSystem.DetachPerformer<IncreaseStatsGA>();
    }

    // 属性增加动作的具体执行逻辑
    private IEnumerator IncreaseStatsPerformer(IncreaseStatsGA increaseStatsGA)
    {
        int attack = increaseStatsGA.AttackIncreaseAmount;
        
        // 调用目标随从的属性增加方法
        yield return increaseStatsGA.Target.IncreaseAttackAndHealth(attack);
    }
}